const {Builder, Browser, By, Key, until} = require('selenium-webdriver');
// Api使用文档
// https://www.selenium.dev/selenium/docs/api/javascript/module/selenium-webdriver/

(async function() {
  let driver = await new Builder().forBrowser(Browser.CHROME).build();
  try {
    await driver.get('https://voice.baidu.com/act/newpneumonia/newpneumonia');
    await driver.findElement(By.css('.Virus_1-1-350_2WNImH a:nth-child(3)')).click();
    await driver.wait(until.elementLocated(By.css('.Sub_1-1-350_cTV6yC')), 10000);
    await driver.findElement(By.css('.Sub_1-1-350_cTV6yC .Sub_1-1-350_2v_FRK:last-child')).click();
    await driver.findElement(By.className('Common_1-1-350_3lDRV2')).click();
    // await driver.findElement(By.css('.search-box-login')).click();
    // await driver.findElement(By.name('phone')).getAttribute('value', 15372285979);
    // await driver.findElement(By.className('geetest_radar_btn')).click();
  } finally {
    // await driver.quit();
  }
})();